// uniCloud-aliyun/cloudfunctions/common/uni-config-center/uni-id/hooks/index.js
module.exports = {
  beforeRegister({
    userRecord,
    clientInfo
  }) {
    if (!userRecord.nickname) {
      userRecord.nickname = userRecord.username
    }
    if (!userRecord.avatar) {
      userRecord.avatar = '/static/default-avatar.png'
    }
    return userRecord
  }
}